//
//  FQOsFormatter.m
//  FQLog
//
//  Created by ffq on 2023/3/13.
//

#import "FQOsFormatter.h"

@implementation FQOsFormatter

- (NSString *)formatLogMessage:(DDLogMessage *)logMessage {
    NSString *logLevel;
    switch (logMessage->_flag) {
        case DDLogFlagError:
            logLevel = @"Error";
            break;
        case DDLogFlagWarning:
            logLevel = @"Warn";
            break;
        case DDLogFlagInfo:
            logLevel = @"Info";
            break;
        case DDLogFlagDebug:
            logLevel = @"Debug";
            break;
        default:
            logLevel = @"Verbose";
            break;
    }
    NSString *formatLog = [NSString stringWithFormat:@"[FQ]%@%@-%ld\n%@",logLevel,logMessage->_function,logMessage->_line,logMessage->_message];
    return formatLog;
}

@end
